package urban_elements

import (
	"time"
)

// 表名也是cache的tag
var TableName = "urban_elements"

// 租户表
type UrbanElements struct {
	Id          int64  `xorm:"pk autoincr"`
	PartnerSign string `xorm:"varchar(64) notnull 'partner_sign'"`

	Lang string `xorm:"varchar(32) null 'lang'"`

	Title   string `xorm:"varchar(64) null 'title'"`
	TitleEn string `xorm:"varchar(64) null 'title_en'"`

	TypeId    int `xorm:"INTEGER notnull default(0) 'type_id'"`
	TypeSubId int `xorm:"INTEGER notnull default(0) 'type_sub_id'"`

	Summary string `xorm:"varchar(512) null 'summary'"`
	Content string `xorm:"text null 'content'"`

	CloseTime   string `xorm:"varchar(32) null 'close_time'"`
	OpenTime    string `xorm:"varchar(32) null 'open_time'"`
	OpenWeekDay string `xorm:"varchar(32) null 'open_week_day'"`

	FeeTicketHas bool   `xorm:"bool null default(false) 'fee_ticket_has'"`
	FeeInnerHas  bool   `xorm:"bool null default(false) 'fee_inner_has'"`
	FeeAmount    string `xorm:"varchar(64) null default('') 'fee_amount'"`

	// 区域 地址
	Country    string `xorm:"varchar(32) notnull default('cn') 'country'"`
	ProvinceId int64  `xorm:"INTEGER notnull default(0) 'province_id'"`
	CityId     int64  `xorm:"INTEGER null default(0) 'city_id'"`
	CircleId   int64  `xorm:"INTEGER null default(0) 'circle_id'"`

	Address string `xorm:"varchar(256) null 'address'"`
	Phone   string `xorm:"varchar(32) null 'phone'"`
	Website string `xorm:"varchar(64) null 'website'"`

	CoordinateX string `xorm:"varchar(64) notnull 'coordinate_x'"`
	CoordinateY string `xorm:"varchar(64) notnull 'coordinate_y'"`
	PlusCode    string `xorm:"varchar(128) notnull 'plus_code'"`

	Tags string `xorm:"varchar(128) null 'tags'"`

	ImageCover string `xorm:"varchar(128) null 'image_cover'"`
	ImageList  string `xorm:"text null 'image_list'"`

	ImageCount int `xorm:"INTEGER null default(0) 'image_count'"`
	ViewCount  int `xorm:"INTEGER null default(0) 'view_count'"`

	IsHot       bool `xorm:"bool null default(false) 'is_hot'"`
	IsRecommend bool `xorm:"bool null default(false) 'is_recommend'"`
	Status      int  `xorm:"bool tinyint default(0) 'status'"`

	CreatedAt time.Time `xorm:"notnull created 'created_at'"`
	UpdatedAt time.Time `xorm:"null updated 'updated_at'"`

	TypeSubTitle  string                   `xorm:"-"`
	ProvinceTitle string                   `xorm:"-"`
	CityTitle     string                   `xorm:"-"`
	ImageCoverUrl string                   `xorm:"-"`
	ImageListArr  []map[string]interface{} `xorm:"-"`
}
